home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / X11 / config / lnxdoc.rules < prev    next >
Text File  |  2006-04-12  |  5KB  |  146 lines

  1. XCOMM $XFree86: xc/config/cf/lnxdoc.rules,v 3.27 2003/01/15 03:17:29 dawes Exp $
  2. XCOMM
  3. XCOMM Rules for formatting Linuxdoc-SGML documentation
  4. XCOMM
  5.  
  6. #include <lnxdoc.tmpl>
  7.  
  8. #ifdef DontInstallLinuxDoc
  9. #define LinuxDocInstall(file,dest)    /* do nothing */
  10. #define LinuxDocInstallMultiple(files,dest)    /* do nothing */
  11. #define LinuxDocInstallIfExists(file,dest)    /* do nothing */
  12. #else
  13. #define LinuxDocInstall(file,dest)    InstallNonExecFile(file,dest)
  14. #define LinuxDocInstallMultiple(files,dest)                @@\
  15. InstallMultipleDest(install,files,dest)
  16.  
  17. #define LinuxDocInstallIfExists(file,dir)                @@\
  18. install::                                @@\
  19.     MakeDir($(DESTDIR)dir)                        @@\
  20.     @if [ -f file ]; then set -x; \                    @@\
  21.       $(INSTALL) $(INSTALLFLAGS) $(INSTDATFLAGS) \            @@\
  22.         file $(DESTDIR)dir; \                    @@\
  23.     fi
  24. #endif
  25.  
  26. /* Version for sgmlfmt */
  27.  
  28. #if BuildLinuxDocPS
  29. #define LinuxDocSgmlToPs(sgmlfile,base)                 @@\
  30. all:: base.ps PdfTarget(base)                        @@\
  31.                                     @@\
  32. base.ps: sgmlfile $(SGMLDEPENDS)                    @@\
  33.     RemoveFile(_$@ $@)                        @@\
  34.     @(BASE=`basename sgmlfile .sgml`;\                @@\
  35.       set -x;\                            @@\
  36.       RemoveFile($$BASE.ps);\                    @@\
  37.       $(SGMLFMTCMD) -f ps sgmlfile && \                @@\
  38.         $(MV) $$BASE.ps _$@ && $(MV) _$@ $@)            @@\
  39.                                     @@\
  40. LinuxDocInstall(base.ps,$(XFREE86PSDOCDIR))                @@\
  41.                                     @@\
  42. ConvertPsToPdf(base)                            @@\
  43.                                     @@\
  44. LinuxDocInstallIfExists(base.pdf,$(XFREE86PDFDOCDIR))            @@\
  45.                                     @@\
  46. clean::                                    @@\
  47.     RemoveFile(Concat(_,base.ps) base.ps)
  48. #else
  49. #define LinuxDocSgmlToPs(sgmlfile,base) /**/
  50. #endif
  51.  
  52. #if BuildLinuxDocText
  53. #define LinuxDocSgmlToText(sgmlfile,textfile)                @@\
  54. AllTarget(textfile)                            @@\
  55.                                     @@\
  56. textfile: sgmlfile $(SGMLDEPENDS)                    @@\
  57.     RemoveFiles(_$@ $@)                        @@\
  58.     @(BASE=`basename sgmlfile .sgml`;\                @@\
  59.       set -x;\                            @@\
  60.       RemoveFile($$BASE.latin1);\                    @@\
  61.       $(SGMLFMTCMD) -f latin1 -b -n sgmlfile && \            @@\
  62.       $(CVSIDENTFIX) < $$BASE.latin1 | $(XORGIDENTFIX) | $(XFREE86IDENTFIX) > _$@ && $(MV) _$@ $@ && \    @@\
  63.       RemoveFile($$BASE.latin1))                    @@\
  64.                                     @@\
  65. LinuxDocInstall(textfile,$(XFREE86DOCDIR))                @@\
  66.                                     @@\
  67. clean::                                    @@\
  68.     @(file=textfile; set -x; RemoveFiles(_$$file $$file))
  69. #else
  70. #define LinuxDocSgmlToText(sgmlfile,textfile) /**/
  71. #endif
  72.  
  73. #if BuildLinuxDocHtml
  74. #define LinuxDocSgmlToHtml(sgmlfile,base)                @@\
  75. AllTarget(base.html)                            @@\
  76.                                     @@\
  77. base.html: sgmlfile $(SGMLDEPENDS)                    @@\
  78.     @if [ sgmlfile != base.sgml ]; then $(LN) sgmlfile base.sgml; fi @@\
  79.     RemoveFiles(base*.html)                        @@\
  80.     $(SGMLFMTCMD) -f html base.sgml || RemoveFile($@)        @@\
  81.     @if [ sgmlfile != base.sgml ]; then RemoveFile(base.sgml); fi    @@\
  82.                                     @@\
  83. LinuxDocInstallMultiple(base*.html,$(XFREE86HTMLDOCDIR))        @@\
  84.                                     @@\
  85. clean::                                    @@\
  86.     RemoveFiles(base*.html)
  87. #else
  88. #define LinuxDocSgmlToHtml(sgmlfile,base) /**/
  89. #endif
  90.  
  91. /*
  92.  * Rule for maintainers to use to updated formatted copies of docs in the
  93.  * source tree.  Use with care.
  94.  */
  95.  
  96. #ifndef UpdateFormattedDocLong
  97. #define UpdateFormattedDocLong(textfile,dstdir,dstfile)            @@\
  98. update.docs:: textfile                            @@\
  99.     -@if [ -f dstdir/dstfile ]; then \                @@\
  100.         if [ "$(FORCEUPDATE)" = yes ]; then set -x; \        @@\
  101.         if [ "$(FOLLOWLINK)" = no ]; then \            @@\
  102.             $(RM) dstdir/dstfile; \                @@\
  103.         fi; \                            @@\
  104.         cp textfile dstdir/dstfile; \                @@\
  105.         echo "" >> dstdir/dstfile; \                @@\
  106.         echo "\$$XdotOrg\$$" >> dstdir/dstfile; \        @@\
  107.         else \                            @@\
  108.         $(RM) __tmp1__ __tmp2__; \                @@\
  109.         fgrep -v "\$$XdotOrg:" textfile > __tmp1__; \        @@\
  110.         fgrep -v "\$$XdotOrg:" dstdir/dstfile > __tmp2__; \    @@\
  111.         if diff -B __tmp1__ __tmp2__ > /dev/null 2>&1; then :; \    @@\
  112.         else set -x; \                        @@\
  113.             if [ "$(FOLLOWLINK)" = no ]; then \        @@\
  114.                 $(RM) dstdir/dstfile; \            @@\
  115.             fi; \                        @@\
  116.             cp textfile dstdir/dstfile ; \            @@\
  117.             echo "" >> dstdir/dstfile; \            @@\
  118.             echo "\$$XdotOrg"": \$$" >> dstdir/dstfile; \    @@\
  119.         fi; \                            @@\
  120.         fi; \                            @@\
  121.     fi                                @@\
  122.     @$(RM) __tmp1__ __tmp2__
  123. #endif
  124.  
  125. #ifndef UpdateFormattedDoc
  126. #define UpdateFormattedDoc(textfile,dstdir)                @@\
  127. UpdateFormattedDocLong(textfile,dstdir,textfile)
  128. #endif
  129.  
  130. /*
  131.  * Avoid using LinuxDocTargetLong with base != sgmlfile because HTML
  132.  * index generation assumes that base == sgmlfile.
  133.  */
  134. #define LinuxDocTargetLong(sgmlfile,textfile,base)            @@\
  135. LinuxDocSgmlToText(sgmlfile,textfile)                    @@\
  136. LinuxDocSgmlToHtml(sgmlfile,base)                    @@\
  137. LinuxDocSgmlToPs(sgmlfile,base)                        @@\
  138. UpdateFormattedDoc(textfile,$(FORMATTEDDIR))
  139.  
  140. #define LinuxDocReadmeTarget(base)                    @@\
  141. LinuxDocTargetLong(base.sgml,ReadmeFile(base),base)
  142.  
  143. #define LinuxDocTarget(base)                        @@\
  144. LinuxDocTargetLong(base.sgml,base,base)
  145.  
  146.